import type { Base } from "../samples/Base";
import OneCube from "../samples/onecubes/OneCube";
import Triangle from "../samples/triangles/Triangle";
import TwoCubes from "../samples/twocubes/main";
import TriangleMSAA from "../samples/triangleMSAA/TriangleMSAA";
import TexturedCube from "../samples/texturedCube/TexturedCube";
import ABuffer from "../samples/a-buffer/Abuffer";
import InstanceCube from "../samples/instanceCube/InstanceCube";
import FractalCube from "../samples/fractalCube/FractalCube";
import CubeMap from "../samples/cubeMap/CubeMap";
import Blending from "../samples/blending/Blending";
import CameraRender from "../samples/cameras/CameraRender";
import MultipleCanvas from "../samples/multipleCanvas/MultipleCanvas";
import GenerateMipmap from "../samples/generateMipmap/generateMipmapRender";
import ImageBlur from "../samples/imgBlur/ImageBlur";
import RenderBundles from "../samples/renderBundles/RenderBundles";
import GameOfLife from "../samples/gameofLife/GameOfLife";
import NormalMap from "../samples/normalMap/normalMap";
import Points from "../samples/points/Points";
import Particles from "../samples/particles/Particles";
import ComputeBoids  from "../samples/computeBoids/ComputeBoids";

export type AppType =
  | "TwoCubes"
  | "OneCube"
  | "Triangle"
  | "AllSamples"
  | "TriangleMSAA"
  | "TexturedCube"
  | "ABuffer"
  | "InstanceCube"
  | "FractalCube"
  | "CubeMap"
  | "Blending"
  | "Camera"
  | "MultipleCanvas"
  | "GenerateMipmap"
  | "ImageBlur"
  | "RenderBundles"
  | "GameOfLife"
  | "NormalMap"
  | "Points"
  | "Particles"
  | "ComputeBoids";
export type App = { name: AppType; instance: Base };

export const apps: App[] = [
  { name: "TwoCubes", instance: new TwoCubes() },
  { name: "OneCube", instance: new OneCube() }, // Placeholder for OneCube
  { name: "Triangle", instance: new Triangle() },
  { name: "TriangleMSAA", instance: new TriangleMSAA() },
  { name: "TexturedCube", instance: new TexturedCube() },
  { name: "ABuffer", instance: new ABuffer() },
  { name: "InstanceCube", instance: new InstanceCube() },
  { name: "FractalCube", instance: new FractalCube() },
  { name: "CubeMap", instance: new CubeMap() },
  { name: "Blending", instance: new Blending() },
  { name: "Camera", instance: new CameraRender() },
  { name: "MultipleCanvas", instance: new MultipleCanvas() }, // Placeholder for MultipleCanvas
  { name: "GenerateMipmap", instance: new GenerateMipmap() },
  { name: "ImageBlur", instance: new ImageBlur() },
  { name: "RenderBundles", instance: new RenderBundles() },
  { name: "GameOfLife", instance: new GameOfLife() },
  { name: "NormalMap", instance: new NormalMap() },
  { name: "Points", instance: new Points() },
  { name: "Particles", instance: new Particles() },
  { name: "ComputeBoids", instance: new ComputeBoids()}
];

export function keysOf<T extends string>(obj: {
  [k in T]: unknown;
}): readonly T[] {
  return Object.keys(obj) as unknown[] as T[];
}
